﻿@model OnlineStore.Web.Models.ProductDetails.AddOrderModel
@{
    ViewData["Title"] = "AddOrder";
    Layout = "_Layout1";
};



    <link href="css/public.css" type="text/css" rel="stylesheet" />
    <link href="~/css/base.css" rel="stylesheet" />
    <link href="~/css/checkout.css" rel="stylesheet" />


<script>
    function addContractId(id) {
        var t = document.getElementById("addCon");
        t.value = id;
    }

</script>

    <!--收货地址body部分开始-->
    <div class="border_top_cart">
        <div class="container">
            <div class="checkout-box">
                <form id="checkoutForm" method="post" asp-action="AddOrder">
                    <div class="checkout-box-bd">
                        <input type="hidden" name="contractId" id="addCon">
                        <!-- 收货地址 -->
                        <div class="xm-box">
                            <div class="box-hd ">
                                <h2 class="title">收货地址</h2>
                                <!---->
                            </div>
                            <div class="box-bd">
                                <div class="clearfix xm-address-list" id="checkoutAddrList">
                                    @foreach (var item in Model.contactInfos)
                                    {
                                        <dl class="item" onclick="addContractId('@item.Id')">
                                            <dt>
                                                <strong class="itemConsignee">@item.Name</strong>
                                            </dt>
                                            <dd>
                                                <p class="tel itemTel">@item.Phone</p>
                                                <p class="itemRegion">@item.Address</p>
                                                @*<span class="edit-btn J_editAddr">编辑</span>*@
                                            </dd>
                                            <dd style="display:none">
                                                <input type="radio" name="Checkout[address]" class="addressId" value="10140916720030323">
                                            </dd>
                                        </dl>
                                    }
                                    <div class="item use-new-addr" id="J_useNewAddr" data-state="off">
                                        <span class="iconfont icon-add"></span>
                                        使用新地址
                                    </div>
                                    <!--点击弹出新增/收货地址界面start-->
                                    @*<div class="xm-edit-addr-box" id="J_editAddrBox">
                                            <div class="bd">
                                                <div class="item">
                                                    <label>收货人姓名<span>*</span></label>
                                                    <input type="text" name="userAddress[consignee]" id="Consignee" class="input" placeholder="收货人姓名" maxlength="15" autocomplete='off'>
                                                    <p class="tip-msg tipMsg"></p>
                                                </div>
                                                <div class="item">
                                                    <label>联系电话<span>*</span></label>
                                                    <input type="text" name="userAddress[tel]" class="input" id="Telephone" placeholder="11位手机号" autocomplete='off'>
                                                    <p class="tel-modify-tip" id="telModifyTip"></p>
                                                    <p class="tip-msg tipMsg"></p>
                                                </div>
                                                <div class="item">
                                                    <label>地址<span>*</span></label>
                                                    <select name="userAddress[province]" id="Provinces" class="select-1">
                                                        <option>省份/自治区</option>
                                                    </select>
                                                    <select name="userAddress[city]" id="Citys" class="select-2" disabled>
                                                        <option>城市/地区/自治州</option>
                                                    </select>
                                                    <select name="userAddress[county]" id="Countys" class="select-3" disabled>
                                                        <option>区/县</option>
                                                    </select>
                                                    <textarea name="userAddress[street]" class="input-area" id="Street" placeholder="路名或街道地址，门牌号"></textarea>
                                                    <p class="tip-msg tipMsg"></p>
                                                </div>
                                                <div class="item">
                                                    <label>邮政编码<span>*</span></label>
                                                    <input type="text" name="userAddress[zipcode]" id="Zipcode" class="input" placeholder="邮政编码" autocomplete='off'>
                                                    <p class="zipcode-tip" id="zipcodeTip"></p>
                                                    <p class="tip-msg tipMsg"></p>
                                                </div>
                                                <div class="item">
                                                    <label>地址标签<span>*</span></label>
                                                    <input type="text" name="userAddress[tag]" id="Tag" class="input" placeholder='地址标签：如"家"、"公司"。限5个字内'>
                                                    <p class="tip-msg tipMsg"></p>
                                                </div>
                                            </div>
                                            <div class="ft clearfix">
                                                <button type="button" class="btn btn-lineDake btn-small " id="J_editAddrCancel">取消</button>
                                                <button type="button" class="btn btn-primary  btn-small " id="J_editAddrOk">保存</button>
                                            </div>
                                        </div>*@
                                    <!--点击弹出新增/收货地址界面end-->


                                    <div class="xm-edit-addr-backdrop" id="J_editAddrBackdrop"></div>
                                </div>
                            </div>
                            <!-- 收货地址 END-->
                            <div id="checkoutPayment">
                                <!-- 支付方式 -->
                                <div class="xm-box">
                                    <div class="box-hd ">
                                        <h2 class="title">支付方式</h2>
                                    </div>
                                    <div class="box-bd">
                                        <ul id="checkoutPaymentList" class="checkout-option-list clearfix J_optionList">
                                            <li class="item selected">
                                                <input type="radio" name="Checkout[pay_id]" checked="checked" value="1">
                                                <p>
                                                    在线支付                                <span></span>
                                                </p>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                <!-- 支付方式 END-->


                                <div class="xm-box">
                                    <div class="box-hd ">
                                        <h2 class="title">配送方式</h2>
                                    </div>
                                    <div class="box-bd">
                                        <ul id="checkoutShipmentList" class="checkout-option-list clearfix J_optionList">
                                            <li class="item selected">
                                                <input type="radio" data-price="0" name="Checkout[shipment_id]" checked="checked" value="1">
                                                <p>
                                                    快递配送（免运费）
                                                </p>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                                <!-- 配送方式 END-->                    <!-- 配送方式 END-->



                                <div class="checkout-box-ft">
                                    <!-- 商品清单 -->
                                    <div id="checkoutGoodsList" class="checkout-goods-box">
                                        <div class="xm-box">
                                            <div class="box-hd">
                                                <h2 class="title">确认订单信息</h2>
                                            </div>
                                            <div class="box-bd">
                                                <dl class="checkout-goods-list">
                                                    <dt class="clearfix">
                                                        <span class="col col-md-2">商品名称</span>
                                                        <span class="col col-md-2">购买价格</span>
                                                        <span class="col col-md-2">购买数量</span>
                                                        <span class="col col-md-4">小计（元）</span>
                                                    </dt>

                                                    @{
                                                        double sumPrice = 0;

                                                    }
                                                    @foreach (var item in Model.productInCart)
                                                    {
                                                        <dd class="item clearfix">
                                                            <div class="item-row">
                                                                <div class="col col-md-2">
                                                                    <div class="g-pic">
                                                                        <img src=@item.Product.ImageUrl width="40" height="40" />
                                                                    </div>
                                                                    <div class="g-info">
                                                                        <a href="#">
                                                                            @item.Product.Name
                                                                        </a>
                                                                    </div>
                                                                </div>

                                                                <div class="col col-md-2">@item.Product.Price</div>
                                                                <div class="col col-md-2">@item.Quantity</div>
                                                                <div class="col col--md-4">(@item.Quantity*@item.Product.Price)</div>
                                                            </div>
                                                        </dd>
                                                        sumPrice += (double)(@item.Quantity * @item.Product.Price);
                                                    }
                                                </dl>

                                                <!-- checkout-count-extend -->
                                                <div class="checkout-price">
                                                    <ul>

                                                        <li>
                                                            订单总额：<span>@sumPrice</span>
                                                        </li>
                                                        <li>
                                                            活动优惠：<span>-0元</span>
                                                        </li>
                                                        <li>
                                                            优惠券抵扣：<span id="couponDesc">-0元</span>
                                                        </li>
                                                        <li>
                                                            运费：<span id="postageDesc">0元</span>
                                                        </li>
                                                    </ul>
                                                    <p class="checkout-total">应付总额：<span><strong id="totalPrice">@sumPrice</strong>元</span></p>
                                                </div>
                                                <!--  -->
                                            </div>
                                        </div>
                                    </div>


                                </div>
                                <!-- 商品清单 END -->
                                <input type="hidden" id="couponType" name="Checkout[couponsType]">
                                <input type="hidden" id="couponValue" name="Checkout[couponsValue]">
                                <div class="checkout-confirm">

                                    <a href="#" class="btn btn-lineDakeLight btn-back-cart">返回购物车</a>
                                    <input type="submit" class="btn btn-primary" value="立即下单" id="checkoutToPay" asp-controller="Orders" asp-action="AddOrder"/>
                                </div>
                            </div>
                        </div>
                    </div>

                </form>

            </div>

        </div>



    </div>

    <!--收货地址body部分结束-->



